package 类加载与字节码技术.反射优化;

import java.lang.reflect.Method;

public class Reflect1 {
    public static void foo() {
        System.out.println("foo...");
    }
    public static void main(String[] args) throws Exception {
        Class<Reflect1> reflect1Class = Reflect1.class;
        Object reflect1 = reflect1Class.newInstance();
        Method foo = reflect1Class.getMethod("foo");
        for (int i = 0; i <= 16; i++) {
            foo.invoke(reflect1);
        }
        System.in.read();
    }
}

